import request from '@/utils/request'

//  门店列表
export function listMemberRule(query) {
  return request({
    url: '/system/valuecardCrossrule/list',
    method: 'get',
    params: query
  })
}

// 储值卡规则列表
export function listRule(query) {
  return request({
    url: '/system/valuecardCrossrule/list',
    method: 'get',
    params: query
  })
}


// 储值卡被设置规则列表
export function listRuleBy(query) {
  return request({
    url: '/system/valuecardCrossrule/listby',
    method: 'get',
    params: query
  })
}

// 门店储值卡列表
export function listStoreMember(query) {
  return request({
    url: '/system/value/card/rule/list',
    method: 'get',
    params: query
  })
}

//详情
export function getMemberRule(id) {
  return request({
    url: '/system/valuecardCrossrule/' + id,
    method: 'get'
  })
}

//新增
export function addMemberRule(data) {
  return request({
    url: '/system/valuecardCrossrule/editAdd',
    method: 'post',
    data: data
  })
}

// 己方审核
export function zyValueCardCrossCheck(data) {
  return request({
    url: '/system/valuecardCrossrule/zyValueCardCrossCheck',
    method: 'post',
    data: data
  })
}

// 被设置方审核
export function zyValueCardCrossCheckBy(data) {
  return request({
    url: '/system/valuecardCrossrule/zyValueCardCrossCheckBy',
    method: 'post',
    data: data
  })
}




//修改
export function updateMemberRule(data) {
  return request({
    url: '/system/valuecardCrossrule',
    method: 'put',
    data: data
  })
}
//删除
export function delMemberRule(id) {
  return request({
    url: '/system/valuecardCrossrule/' + id,
    method: 'delete'
  })
}

export function listMemberRegion(query) {
  return request({
    url: '/system/region/addList',
    method: 'get',
    params: query
  })
}
export function listMemberStore(query) {
  return request({
    url: '/system/store/allList',
    method: 'get',
    params: query
  })
}
//提交(新)
export function submitCross(data) {
  return request({
    url: '/system/valuecardCrossrule/editAdd',
    method: 'post',
    data: data
  })
}

//删除规则
export const deleteRule = (id) => {
  return request({
    url: `/system/valuecardCrossrule/${id}`,
    method: 'delete'
  })
}